package com.iterator.self;

import java.util.Iterator;

public class InfoCompanyIterator implements Iterator {

    Sector [] sectors;

    int index=-1;

    public InfoCompanyIterator(Sector[] sectors) {
        this.sectors = sectors;
    }

    @Override
    public boolean hasNext() {
        if(index< (sectors.length-1)){
            index++;
            return true;
        } else {
            return false;
        }
    }

    @Override
    public Object next() {
        return sectors[index];
    }

    @Override
    public void remove() {

    }
}
